// pages/components/tab/index.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    tabIndex: { type: Number, value: 0 },
  },

  /**
   * 组件的初始数据
   */
  data: {
    tabs: [
      {
        url: "/static/img/logo6.png",
        active: "/static/img/logo7.png",
        path:"/pages/index/index",
        text: "测量"
      },
      {
        url: "/static/img/logo8.png",
        active: "/static/img/logo9.png",
        path: "/pages/data/index",
        text: "数据"
      },
      {
        url: "/static/img/logo2.png",
        active: "/static/img/logo3.png",
        path: "/pages/my/index",
        text: "我的"
      },
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    tabBtn(e){
      var index = e.currentTarget.dataset.index;
      var tabs = this.data.tabs;
      console.log(index);
      wx.reLaunch({
        url: tabs[index].path,
      })
    }
  }
})
